<template>
    <div class="assetInventoryDatail" ref="requireRepairDetail">
        <div class="headerBreadcrumb">
            <header-breadcrumb :breadcrumbItem="breadcrumbItem"></header-breadcrumb>
            <div class="tableBody">  
                <div>
                    本次盘点资产：<span>{{totalInfo.asset_total }}</span><span> 件</span>
                    参与盘点部门：<span>{{totalInfo.dept_total }}</span><span> 个</span>
                    参与盘点员工：<span>{{totalInfo.user_total }}</span><span> 名</span>
                    已经盘点：<span>{{totalInfo.check_total }}</span><span> 件</span>      
                    未盘点：<span>{{totalInfo.not_check_total }}</span><span> 件</span> 
                </div>
                <lpj-table-vue :baseNum='paginationMes.per_page*(paginationMes.current_page-1)' ref="lpjTable" :tableData="tableData" :tableHeaderData="tableHeaderData"></lpj-table-vue>
                <pagination v-if="paginationMes.total&&paginationMes.total>10" align="right" :paginationMes="paginationMes" @sizeChangeFn="sizeChangeFn" @currentChangeFn="currentChangeFn"></pagination>
            </div>
        </div>
       <!-- 基本信息 -->
    </div>
</template>

<script>

/* eslint-disable */
import headerBreadcrumb from "@/components/headerBreadcrumb"
import Pagination from "@/components/Pagination"
import LpjTableVue from "@/components/LpjTableVue"
import {getAssetcheckContent,getTotal} from "./api"
export default {
    name: 'assetInventoryDatail',
    components:{
        headerBreadcrumb,
        Pagination,
        LpjTableVue,
    },
    data(){
        return{
            breadcrumbItem:[{name:'创建盘点任务'},{name:'盘点任务明细'}],
            tableHeaderData:[ /**报失申请 */
                {label:"序号",  prop:"sortNum",},
                {label:"资产名称",prop:"f_name",islink:true},
                {label:"编码",prop:"f_code", },
                {label:"单价",prop:"f_unit_price", },
                {label:"分类",prop:"category_name", },
                {label:"入库时间",prop:"f_storage_date",},
                {label:"使用人",prop:"check_user_name",},
                {label:"领用部门", prop:"dept_name",},
                {label:"盘点结果",prop:"check_res_name",},
                {label:"盘点备注",prop:"check_remark",},
                {label:"盘点状态",prop:"is_check_name"},
            ],
            /*操作列表table里的数据 */
            tableData:[],
            totalInfo:{},
            /*分页 数据*/
            paginationMes:{per_page:10,current_page:1,totol:0}, /**操作列表分页参数 */
        }
    },
    created(){
        this.messageSearch();
         /**获取详情统计 */
        getTotal({id:this.$route.query.id}).then(res=>{
            this.totalInfo = res
        })
    },
    methods: {
        /**获取详情列表 */
        messageSearch(){
            let params = {num:this.paginationMes.per_page,page:this.paginationMes.current_page,id:this.$route.query.id}
            getAssetcheckContent(params).then(res=>{
                this.paginationMes={total:Number(res.total),per_page:Number(res.per_page),current_page:Number(res.current_page),}
                this.tableData=res.data
            })
        },
        /*操作列表分页传过来的 当前第几页 */
        currentChangeFn(val){
            this.paginationMes.current_page = val||1//当前页数
            this.messageSearch()
        },
        /*操作列表分页传过来的 table每页的条数*/
        sizeChangeFn(val){
            this.paginationMes.current_page=1
            this.paginationMes.per_page = val||10//当前页数
            this.messageSearch()
        },
    }
}
</script>

<style lang="stylus" scoped>
.assetInventoryDatail
    font-size 14px
    .tableBody
        background-color #fff
        padding 20px 40px
        >div:first-child 
            height: 90px;
            line-height: 90px;
            padding-left 27px
            background-color: rgba(247, 246, 251, 1);
            margin-bottom 20px
            >span:nth-of-type(2n+1)
                color rgba(49, 150, 250, 1)
            >span:nth-of-type(2n)
                padding-right 15px

</style>
